﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crawler.TaskControl;
using Util;
using Crawler;

namespace Crawler4xlbk
{
    class Program
    {
        static void Main(string[] args)
        {
            //InjectTasks();
            Console.WindowWidth = 120;
            CrawlerXLBK crawler = new CrawlerXLBK();
            crawler.Fetch();
            Console.WriteLine("run over ,enter exit");
            Console.ReadLine();
        }


        static void InjectTasks() 
        {
            List<CrawlTask> Tasks = new List<CrawlTask>();

            CrawlTask task0 = new CrawlTask();
            task0.ID = 0;
            task0.Name = "暴走漫画";
            task0.SeedUrl = "http://baozoumanhua.com/";
            Tasks.Add(task0);

            CrawlTask task1 = new CrawlTask();
            task1.ID = 1;
            task1.Name = "GIF怪兽";
            task1.SeedUrl = "http://gifguaishou.com/";
            Tasks.Add(task1);

            CrawlTask task2 = new CrawlTask();
            task2.ID = 2;
            task2.Name = "趣图百科";
            task2.SeedUrl = "http://qutubaike.com/";
            Tasks.Add(task2);

            CrawlTask task3 = new CrawlTask();
            task3.ID = 3;
            task3.Name = "神吐槽";
            task3.SeedUrl = "http://shentucao.com/";
            Tasks.Add(task3);

            XmlUtil.XmlSerialize(Tasks, "input\\tasks.xml");
        }
    }
}
